<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <table>
        <tr>
            <th>全选<input id="all" type="checkbox" onclick="myAll()" /></th>
            <th>序号</th>
            <th>名称</th>
            <th>单价</th>
            <th>数量</th>
            <th>总计</th>
        </tr>
        <tr>
            <td><input name="one" type="checkbox" onclick="myOne()" /></td>
            <td>1</td>
            <td>物品A</td>
            <td>￥55</td>
            <td>1</td>
            <td>￥55</td>
        </tr>
        <tr>
            <td><input name="one" type="checkbox" onclick="myOne()" /></td>
            <td>2</td>
            <td>物品B</td>
            <td>￥70</td>
            <td>1</td>
            <td>￥70</td>
        </tr>
        <tr>
            <td><input name="one" type="checkbox" onclick="myOne()" /></td>
            <td>3</td>
            <td>物品C</td>
            <td>￥66</td>
            <td>1</td>
            <td>￥66</td>
        </tr>
    </table>
    
</body>
<script>
    
    let myall=document.getElementById('all')
    let inps=document.querySelectorAll("[name=one]")
    function myAll(){
        console.log(inps);
        for(let i=0;i<inps.length;i++){
            console.log(inps[i]);
            inps[i].checked=myall.checked
            
        }
    }
    function myOne(){
        for(let i=0;i<inps.length;i++){
            if(!inps[i].checked){
               return  myall.checked = false
                  
            }
        }
        return myall.checked=true
    }
</script>

</html>